#include <iostream>
#include <fstream>
#include <vector>
#include <sstream>
#include <cmath>
#include <omp.h>
struct Point {
    double latitude;
    double longitude;
    double averageSignal;
    double range;
    int cluster;
};

std::vector<Point> readData(const std::string& filename) {
    std::vector<Point> data;
    std::ifstream file(filename);
    std::string line;

    // Skip header line
    std::getline(file, line);

    while (std::getline(file, line)) {
        std::stringstream ss(line);
        std::string token;
        Point point;

        std::getline(ss, token, ','); // Skip Index
        std::getline(ss, token, ','); // Radio
        std::getline(ss, token, ','); // MCC
        std::getline(ss, token, ','); // MNC
        std::getline(ss, token, ','); // TAC
        std::getline(ss, token, ','); // CID
        std::getline(ss, token, ','); // Unit

        std::getline(ss, token, ',');
        point.longitude = std::stod(token);

        std::getline(ss, token, ',');
        point.latitude = std::stod(token);

        std::getline(ss, token, ',');
        point.range = std::stod(token);

        std::getline(ss, token, ','); // Samples

        std::getline(ss, token, ','); 
        point.averageSignal = std::stod(token);

        data.push_back(point);
    }
    return data;
}